﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Aishow.Website
{
    public partial class Discuss : System.Web.UI.Page
    {
        protected string VideoId { get; set; } 
        protected string NickName { get; set; }
        protected string Avatar { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            VideoId = Request.QueryString["id"];
            var user = IdentityManager.ReadUser();
            if (user==null)
            {
                Response.Redirect("~/Login.aspx?ReturnUrl="+Request.Url);
            }
            else if (string.IsNullOrWhiteSpace(VideoId))
            {
                Response.Redirect("/default.aspx");
            }
            NickName = user.NickName ?? $"用户{user.Id}";
            Avatar = user.Avatar ?? "/imgs/avatar.jpg";

        }
    }
}